import QtQuick 1.1
import com.nokia.symbian 1.1

import "logicaObject.js" as LogicaObject



Page {
    id:root
    tools: ToolBarLayout {        
        ToolButton {
            iconSource: "toolbar-back"
            onClicked: root.pageStack.pop();
        }
    }

    Component.onCompleted: {
        var obj = LogicaObject.createObject(root.toString(), grdSobre.columns);
        grdSobre.desenhar();
    }

    Component.onDestruction: {
        LogicaObject.deleteObject(root.toString());
    }

    Image {
        source: "qrc:///infoGrande"
        anchors { right: parent.right; top: parent.top }
    }

    Timer {
        running: Qt.application.active && root.status == PageStatus.Active
        interval: 100
        repeat: true
        onTriggered: {
            var jogada = LogicaObject.instancias[root.toString()].jogadaAleatoria();
            grdSobre.mover(null, jogada[0]);
        }
    }

    MeuGrid {
        id: grdSobre
        keyObject: root.toString()
        enabled: false
        anchors.centerIn: parent
        y: 60
        opacity: 0.3
    }

    Column {
        spacing: 10
        anchors.centerIn: parent
        z: grdSobre.z + 1

        Text {
            text: "NumEmOrdem v1.0"
            font.pixelSize: 25
            font.italic: true
            color: platformStyle.colorNormalLight
        }

        Flow {
            spacing: 5
            Text {
                text: qsTr("_desenvolvido_")
                font.pixelSize: 18
                color: platformStyle.colorNormalLight
            }
            Text {
                text: "Rogério Paladino"
                font.pixelSize: 18
                color: platformStyle.colorNormalLight
            }
        }
   }
}
